package pl.edu.mimuw.mas.utils;

import pl.edu.mimuw.mas.chart.Chart;
import pl.edu.mimuw.mas.gui.MainWindow;
import pl.edu.mimuw.mas.tools.PeriodModifier;

public final class ServiceRunner {
	
	public static final String CONF_WINDOW_TITLE = "panel administracyjny";
	public static final int CONF_WINDOW_X = 800;
	public static final int CONF_WINDOW_Y = 600;
	
	public static final String CONF_SPEED_TAB_NAME = "Speed";
	
	public static final String AGENT_VIZ2D_NAME = "viz2d";
	public static final String AGENT_VIZ3D_NAME = "viz3d";
	public static final String AGENT_LOG_NAME = "log";
	
	public static void runServices(Chart chart, PeriodModifier modifier) {
		MainWindow window = new MainWindow(CONF_WINDOW_TITLE, CONF_WINDOW_X, CONF_WINDOW_Y, modifier);
		
		JadeRunner.runLocalJade();
		
		JadeRunner.runAgent(AGENT_VIZ2D_NAME,
				"pl.edu.mimuw.mas.agent.Visualization2DAgent", 
				new Object[] {chart.getColumnsCount(), chart.getRowsCount(), window, true });
		
		JadeRunner.runAgent(AGENT_VIZ3D_NAME,
				"pl.edu.mimuw.mas.agent.Visualization3DAgent", 
				new Object[] {chart, window, true });
		
		JadeRunner.runAgent(AGENT_LOG_NAME, "pl.edu.mimuw.mas.agent.LogAgent",
				new Object[] { window, true });
	}
}
